import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/register',
    component: () => import('@/views/Register.vue')
  },
  {
    path: '/layout',
    component: () => import('@/components/Layout.vue'),
    children:[
      {
        path: '',
        component: () => import('@/views/Welcome.vue')
      },
      {
        path: 'welcome',
        component: () => import('@/views/Welcome.vue')
      },
      {
        path: 'productType',
        component: () => import('@/views/ProductType.vue')
      },
      {
        path: 'loanProduct',
        component: () => import('@/views/LoanProduct.vue')
      },
      {
        path: 'userInfo',
        component: () => import('@/views/UserInfo.vue')
      },
      {
        path: 'bankInfo',
        component: () => import('@/views/BankInfo.vue')
      },
      {
        path: 'echartsx',
        component: () => import('@/views/Echartsx.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
